How To Use Transactions SQL Server
2108
09-Mar-2016
We want to Use Transactions SQL Server . How to do this please help me.
Updated on 09-Mar-2016
Anonymous User
09-Mar-2016Transaction is a set of T-SQL statements that are executed together as a unit like as a single T-SQL statement.
If all of these T-SQL statements executed successfully,
then a transaction is committed and the changes made by T-SQL statements permanently saved to database.
If any of these T-SQL statements within a transaction fail, then the complete transaction is cancelled/ rolled back.
We use transaction in that case, when we try to modify more than one tables/views that are related to one another.
Transactions affect SQL Server performance greatly.
Since When a transaction is initiated then it locks all the tables data that are used in the transaction.
Hence during transaction life cycle no one can modify these tables’
data that are used by the transaction.
The reason behind the locking of the data is to maintain Data Integrity.